package ysm.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import ysm.entity.Codetable;
import ysm.entity.Codetabledetail;
import ysm.service.CodetableService;

@RestController
@RequestMapping("/user")
public class CodeTableController {

	@Autowired
	private CodetableService codetableService;
	
	@RequestMapping("/loadCodetalbeByName")
	public List loadCodetalbeByName(String name) {
		return codetableService.loadCodetalbeByName(name);
	}
	
	@RequestMapping("/loadAllCodetable")
	public List loadAll() {
		return codetableService.loadAll();
	}
	
	@RequestMapping("/insertCodetableDetail")
	public void insert(Codetabledetail record) {
		codetableService.insertCodetableDetail(record);
	}
	
	@RequestMapping("/deleteByPrimaryKey")
	public void deleteByPrimaryKey(Integer id) {
		codetableService.deleteByPrimaryKey(id);
	}
}
